﻿using JustMetClient.Commons;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace JustMetClient.Modules.SocketModule
{
    public class SocketHeartbeat
    {
        public static void Start()
        {
            Task.Factory.StartNew(() =>
            {
                while (!R.Socket.ConnectCancelToken.IsCancellationRequested)
                {
                    if (R.Socket.Current.SendHeartbeat()) { }
                    Thread.Sleep(25 * 1000);
                }
            });
        }
    }
}
